'''
Created on 15/03/2012

@author: nicolas
'''

import pylab as p
from matplotlib.pyplot import plot

N = 200
K = 50

resultado = []

for n in range(N + 1):
    sumatoria = 0
    for k in range(K + 1): 
        sumatoria += p.cos(p.pi * k * n / 32)
    resultado.append(sumatoria)


plot(resultado)
p.savefig('ej11_e_n'+str(N)+'_k'+str(K)+'.png')
p.show()
